<template>
    <div class="content">
        <img src="http://city-card.oss-cn-hangzhou.aliyuncs.com/epidemic-situation/es-header.png"
             class="hd-img-responsive"/>
        <div v-for="item in one" :key="item.id">
            <van-cell-group @click="toInfo(item.id)">
                <van-cell
                        :title="item.title"
                        :value="item.update_time"/>
            </van-cell-group>
        </div>
    </div>
</template>
<script>import { epidemicSituationList } from '@/api/yi-qing-fang-kong.js'

export default {
  name: 'index',
  data () {
    return {
      one: []
    }
  },
  methods: {
    toInfo (id) {
      if (id === '17') {
        window.location.href = 'http://www.shenyang.gov.cn/files/ueditor/SY/jsp/upload/file/20200201/1580551205158014822.pdf'
      } else {
        this.$router.push({
          name: 'epidemic-info',
          query: {
            id: id
          }
        })
      }
    },
    init (data) {
      epidemicSituationList(data).then(ret => {
        this.one = ret.data.data
        console.log(ret.data)
      })
    }
  },

  mounted () {
    let data = { type_id: '2' }
    this.init(data)
  }
}
</script>

<style scoped>
    .content >>> .van-cell {
        font-size: 12px;
        line-height: inherit;
    }

    .content >>> .van-cell__title, .van-cell__value {
        flex: inherit;
    }

    .content >>> .van-cell__title {
        width: 65%;
    }

    .content >>> .van-cell__value {
        width: 35%;
    }
</style>
